<template>
  <el-tree-select
      v-model="props.DepartmentPosition.treeDefault.positionName"
      :data="props.DepartmentPosition.recursionPositionList"
      check-strictly
      :props="propsf"
      :render-after-expand="false"
      @node-click="selectMenu"
      :value-key="props.DepartmentPosition.treeDefault.positionId"
      highlight-current
      node-key="positionId"
      ref="treef"
  />
</template>

<script setup>
import {defineProps, ref, onMounted} from "vue";
import axios from "axios";

const props =defineProps ({
  DepartmentPosition: {
    type: Object,
  },
  treeDefault:{
    type: Object,
  }
});

const selectMenu =(val)=>{
  props.DepartmentPosition.treeDefault.positionName =val.positionName
  props.DepartmentPosition.treeDefault.positionId=val.positionId
  console.log(val)
}
console.log(props.DepartmentPosition,"ffg")
const propsf = {
  label: 'positionName',
  children: 'positionTableList',
}
const menuId= ()=>{
  return props.DepartmentPosition.treeDefault.positionId;
}

const positionData = ref()
onMounted(()=>{
  axios.get("http://localhost:1688/position_con/recursionPosition").then(data=>{
    positionData.value =data.data.data;
    console.log(positionData)
  })
})
const treef = ref();
const gaoliang = (id)=>{
  treef.value.setCurrentKey(id)
}
defineExpose({ gaoliang,menuId})
</script>

<style scoped>

</style>